﻿using System;
using System.Linq;
using System.Text;
using System.ComponentModel;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.DC;
using System.Collections.Generic;
using DevExpress.ExpressApp.Model;
using DevExpress.ExpressApp.Editors;
using DevExpress.ExpressApp.Actions;
using DevExpress.ExpressApp.Updating;
using DevExpress.ExpressApp.Model.Core;
using DevExpress.ExpressApp.Model.DomainLogics;
using DevExpress.ExpressApp.Model.NodeGenerators;
using DevExpress.Persistent.BaseImpl;
using System.Web.UI;
using DevExpress.ExpressApp.Templates;

namespace Marbid.Module.Web
{
    public interface IHintPlaceHolderWeb : IFrameTemplate
    {
        Control HintPlaceHolder
        {
            get;
        }
    }
    [ToolboxItemFilter("Xaf.Platform.Web")]
  // For more typical usage scenarios, be sure to check out https://documentation.devexpress.com/eXpressAppFramework/clsDevExpressExpressAppModuleBasetopic.aspx.
  public sealed partial class MarbidAspNetModule : ModuleBase
  {
    //private void Application_CreateCustomModelDifferenceStore(Object sender, CreateCustomModelDifferenceStoreEventArgs e) {
    //    e.Store = new ModelDifferenceDbStore((XafApplication)sender, typeof(ModelDifference), true, "Web");
    //    e.Handled = true;
    //}
    private void Application_CreateCustomUserModelDifferenceStore(Object sender, CreateCustomModelDifferenceStoreEventArgs e)
    {
      e.Store = new ModelDifferenceDbStore((XafApplication)sender, typeof(ModelDifference), false, "Web");
      e.Handled = true;
    }
    public MarbidAspNetModule()
    {
      InitializeComponent();
    }
    public override IEnumerable<ModuleUpdater> GetModuleUpdaters(IObjectSpace objectSpace, Version versionFromDB)
    {
      return ModuleUpdater.EmptyModuleUpdaters;
    }
    public override void Setup(XafApplication application)
    {
      base.Setup(application);
      //application.CreateCustomModelDifferenceStore += Application_CreateCustomModelDifferenceStore;
      application.CreateCustomUserModelDifferenceStore += Application_CreateCustomUserModelDifferenceStore;
      // Manage various aspects of the application UI and behavior at the module level.
    }
  }
}
